#pragma once
#include "pch.h"

using namespace Windows::ApplicationModel::Core;
// - IFrameworkView
// - IFrameworkViewSource
// - CoreApplicationView
using namespace Platform;
// - String
using namespace Windows::UI::Core;
// - CoreWindow
using namespace Windows::Foundation;
// - TypedEventHandler
using namespace Windows::ApplicationModel::Activation;
// - IActivatedEventArgs

ref class DirectXView sealed : public IFrameworkView
{
public:
	virtual void Initialize(CoreApplicationView^ applicationView)
	{
		applicationView->Activated += ref new TypedEventHandler<CoreApplicationView ^, IActivatedEventArgs^ > ( this, &DirectXView::OnActivated);
	}

	void OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args)
	{
		CoreWindow::GetForCurrentThread()->Activate();
	}

	virtual void Load(String^ entryPoint)
	{

	}

	virtual void Run()
	{
		while (true)
		{

		}
	}

	virtual void  SetWindow(CoreWindow^ window)
	{

	}
	
	virtual void Uninitialize()
	{

	}
};

ref class DirectXViewSource sealed : public IFrameworkViewSource
{
public:
	virtual IFrameworkView^ CreateView()
	{
		return ref new DirectXView();
	}
};

int main (Array<String^>^)
{
	CoreApplication::Run(ref new DirectXViewSource());

	return 0;
}